package org.itboys.core.dto.common;


import org.itboys.core.common.Desc;

import java.lang.reflect.Field;

/**
 * 作者：zzq
 * 时间：2018/9/6
 * 描述：返回前端dto基类
 */
public class BaseDto {
    protected long id;
    private String createTime;//数据创建时间（年月日 时:分:秒）。
    //用于给前端解释字段意思   （前提该字段使用了@Desc注解）
    private String info;//字段信息

    public BaseDto() {

    }

    public BaseDto(long id, String createTime
    ) {
        this.id = id;
        this.createTime = createTime;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    /*public String getInfo() {
        return info;
    }*/

    /*{
        Field[] fields = this.getClass().getDeclaredFields();
        String info = "";
        for (Field field : fields) {
            if (field.isAnnotationPresent(Desc.class)) {
                Desc annotation = (Desc) field.getAnnotation(Desc.class);
                String annotationName = annotation.value();
                String fieldName = field.getName();
                info += fieldName + ":" + annotationName + ",";
            }
        }
        this.info = info.substring(0, info.length() - 1);
    }*/
}
